<?php $this->load->view('layout/header'); ?>
<form name="form1" method="post" action="<?php echo b_url('extension/link_action').'/'.$info['linkid'];?>" onsubmit="javascript:return WebForm_OnSubmit();" id="form1">

<div>
</div>
    <div id="container">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table_form">
            <tr class="table_form_title">
                <td colspan="4">
                    <span id="lblTitle">添加</span>
                    友情链接
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>语言版本：
                </td>
                <td>
                    <select name="configid" id="configid">
                        <option value="-1">请选择</option>
                        <?php foreach($config as $k=>$v) : ?>
                        <option value="<?php echo $v['configid']?>" <?php if($v['configid'] == $info['configid']){echo 'selected="selected"';}?>><?php echo $v['languagever']?></option>
                        <?php endforeach ;?>
                    </select>
                    <span id="configid_tips" style="color:Red;display:none;">请选择</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>链接类型：
                </td>
                <td>
                    <span id="radTypeID">
                        <input id="radTypeID_0" type="radio" name="typeid" value="1" <?php if($info['typeid'] == 1 || empty($info)){echo 'checked="checked"';}?> /><label for="radTypeID_0">文字链接</label>
                        <input id="radTypeID_1" type="radio" name="typeid" value="2" <?php if($info['typeid'] == 2){echo 'checked="checked"';}?>onclick="javascript:setTimeout(&#39;__doPostBack(\&#39;radTypeID$1\&#39;,\&#39;\&#39;)&#39;, 0)" /><label for="radTypeID_1">图片链接</label>
                    </span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>网站名称：
                </td>
                <td>
                    <input name="sitename" type="text" id="sitename" value="<?php echo $info['sitename']?>" />
                    <span id="sitename_tips" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>网站链接：
                </td>
                <td>
                    <input name="siteurl" type="text" id="siteurl" value="<?php echo $info['siteurl']?>" />
                    <span id="siteurl_tips" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    Logo地址：
                </td>
                <td>
                    <input name="logourl" type="text" id="txtLogoUrl" value="<?php echo $info['logourl']?>" />
                    <input type="button" value="上传图片" id="btUpload1" />
                    <input type="button" value="选择图片" id="btSelect1" />
                    <input type="button" value=" 预览 " id="btPreview1" />
                    <span id="logourl_tips" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>排序号：
                </td>
                <td>
                    <input name="listid" num="true" type="text"  id="txtListID" value="<?php echo $info['listid']?$info['listid']:0;?>" />
                    <span id="listid_tips" style="color:Red;display:none;">不能为空</span>
                    <span id="listid_num_tips" style="color:Red;display:none;">只能为数字</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    是否关闭：
                </td>
                <td>
                    <span id="radIsClose">
                        <input id="radIsClose_0" type="radio" name="isclose" value="1" <?php if($info['isclose'] == 1){echo 'checked="checked"';}?> /><label for="radIsClose_0">是</label>
                        <input id="radIsClose_1" type="radio" name="isclose" value="0" <?php if($info['isclose'] == 0 || empty($info)){echo 'checked="checked"';}?> /><label for="radIsClose_1">否</label>
                    </span>
                </td>
            </tr>
            <tr class="table_form_btn">
                <td align="right">
                    &nbsp;
                </td>
                <td colspan="3">
                    <input type="submit"  value="保存" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;btnSave&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="btnSave" />
                    <input type="button"  value="返回" onclick="javascript:history.go(-1);" />
                    <span id="errMsg" style="color:Red;"></span>
                </td>
            </tr>
        </table>
    </div>
    
<script type="text/javascript">
$('#form1').submit(function() {
	var is = true;
	if (!input_tips($('#sitename'))) {
	    is = false;
	}
	if (!selete_tips($('#configid'))) {
	    is = false;
	}
	if (!input_tips($('#siteurl'))) {
	    is = false;
	}
	if (!input_tips($('#logourl'))) {
	    is = false;
	}
	if (!input_tips($('#listid'))) {
	    is = false;
	}
	return false;
})
</script>
</form>
<?php $this->load->view('layout/footer'); ?>
